﻿
#region Imports...
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CBRSystem.Web.UI;
#endregion

public partial class CourseEdit : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{		
		FormUtil.RedirectAfterInsertUpdate(FormView1, "CourseEdit.aspx?{0}", CourseDataSource);
		FormUtil.RedirectAfterAddNew(FormView1, "CourseEdit.aspx");
		FormUtil.RedirectAfterCancel(FormView1, "Course.aspx");
		FormUtil.SetDefaultMode(FormView1, "CourseId");
	}
	protected void GridViewCourseOffering1_SelectedIndexChanged(object sender, EventArgs e)
	{
		string urlParams = string.Format("CourseOfferingId={0}", GridViewCourseOffering1.SelectedDataKey.Values[0]);
		Response.Redirect("CourseOfferingEdit.aspx?" + urlParams, true);		
	}	
	protected void GridViewCoursePrerequisite2_SelectedIndexChanged(object sender, EventArgs e)
	{
		string urlParams = string.Format("Id={0}", GridViewCoursePrerequisite2.SelectedDataKey.Values[0]);
		Response.Redirect("CoursePrerequisiteEdit.aspx?" + urlParams, true);		
	}

    // DG-Note: Commented out due to code generation error; code template cannot handle tables with two foreign keys to the same foreign table.
    //protected void GridViewCoursePrerequisite3_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    string urlParams = string.Format("Id={0}", GridViewCoursePrerequisite3.SelectedDataKey.Values[0]);
    //    Response.Redirect("CoursePrerequisiteEdit.aspx?" + urlParams, true);		
    //}	
}


